/**
 * 
 */
package com.wubo.bm.user.entity;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

import com.wubo.bm.user.acl.UserInfoAcl;
import com.wubo.sec.acl.core.AclModel;
import com.wubo.sec.acl.core.GlobalAcl;
import com.wubo.sec.model.User;

/**
 * 用户资料
 * @author WuBo
 * @CreateDate 2012-3-2 下午05:38:59
 */
@Entity
@Table(name="UserInfo")
public class UserInfo implements AclModel {
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private Integer id;
	private int gender; //性别
	private int age; //年龄
	private String country; //国家
	private String province; //省份
	private String city; //城市 
	private String county; //县/区
	private int bloodType;//血型
	private String address;//联系地址
	private String cellphone; //移动电话
	private String telephone; //电话
	private Date birthday; //生日
	private int birthdayType; //生日类型（阳历或阴历）
	private String headAddr;//头像地址
	private String org; //所属组织
	private String department; //部门
	private String job; //职务
	
	@OneToOne(targetEntity=User.class, fetch=FetchType.EAGER)
	@JoinColumn(name="username")
	private User user;

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public int getGender() {
		return gender;
	}

	public void setGender(int gender) {
		this.gender = gender;
	}

	public int getAge() {
		return age;
	}

	public void setAge(int age) {
		this.age = age;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getProvince() {
		return province;
	}

	public void setProvince(String province) {
		this.province = province;
	}

	public String getCity() {
		return city;
	}

	public void setCity(String city) {
		this.city = city;
	}

	public String getCounty() {
		return county;
	}

	public void setCounty(String county) {
		this.county = county;
	}

	public int getBloodType() {
		return bloodType;
	}

	public void setBloodType(int bloodType) {
		this.bloodType = bloodType;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getDepartment() {
		return department;
	}

	public void setDepartment(String department) {
		this.department = department;
	}

	public String getJob() {
		return job;
	}

	public void setJob(String job) {
		this.job = job;
	}

	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public String getCellphone() {
		return cellphone;
	}

	public void setCellphone(String cellphone) {
		this.cellphone = cellphone;
	}

	public String getTelephone() {
		return telephone;
	}

	public void setTelephone(String telephone) {
		this.telephone = telephone;
	}

	public Date getBirthday() {
		return birthday;
	}

	public void setBirthday(Date birthday) {
		this.birthday = birthday;
	}

	public int getBirthdayType() {
		return birthdayType;
	}

	public void setBirthdayType(int birthdayType) {
		this.birthdayType = birthdayType;
	}

	public String getHeadAddr() {
		return headAddr;
	}

	public void setHeadAddr(String headAddr) {
		this.headAddr = headAddr;
	}

	public String getOrg() {
		return org;
	}

	public void setOrg(String org) {
		this.org = org;
	}
	
	@Override
	public GlobalAcl getAcl() {
		return new UserInfoAcl(this);
	}
}
